package org.freedom.imarket.controller;

import java.util.List;

import org.freedom.imarket.dao.CategoriaDAO;
import org.freedom.imarket.entities.Categoria;
import org.freedom.util.CloneHibernate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class CategoriaController {

	@Autowired
	CategoriaDAO categoriaDao;
	
	
	@RequestMapping(value="/**/categoria/list.do")
	@ResponseBody
	public List<Categoria> loadCategorie() throws Exception{
		return CloneHibernate.cloneHibernateList(categoriaDao.loadAll());
	}
}
